package cn.highedu.spring.bean17;


import javax.annotation.PostConstruct;

public class TransferServiceImpl implements TransferService {

    AccountRepository accountRepository;

    public TransferServiceImpl(){
        System.out.println("创建TransferServiceImpl");
    }

    public TransferServiceImpl(AccountRepository accountRepository){
        this.accountRepository = accountRepository;
    }

    public void transfer(int money){
        System.out.println("转账："+money);
    }

    @Override
    public void setAccountRepository(AccountRepository accountRepository) {
        this.accountRepository = accountRepository;
    }

    @Override
    public AccountRepository getAccountRepository() {
        return accountRepository;
    }

    public void init(){
        System.out.println("初始化TransferServiceImpl");
    }
}
